function compute_area() {
	return this.width * this.height;
}

var page = new Rectangle(8.5, 11);
page.area = compute_area;

var a = page.area();

//------//
function Rectangle_area() {return this.width * this.height;}
function Rectangle_perimeter() {return 2 * this.width + 2 * this.height;}
function Rectangle_set_size(w, h) {this.width = w; this.height = h;}
function Rectangle_enlarge() {this.width *= 2; this.height *= 2;}
function Rectangle_shrink() {this.width /= 2; this.height /= 2;}

function Rectangle(w, h) {
	this.width = w;
	this.height = h;
	
	this.area = Rectangle_area();
	this.perimeter = Rectangle_perimeter();
	this.set_size = Rectangle_set_size;
	this.enlarge = Rectangle_enlarge();
	this.shrink = Rectangle_shrink();
}

var r = new Rectangle(2, 2);
var a = r.area();
r.enlarge;
var p = r.perimeter();
